cmake_minimum_required(VERSION 3.16)

get_filename_component(ProjectID ${CMAKE_CURRENT_SOURCE_DIR} NAME)
string(REPLACE " " "_" ProjectID ${ProjectID})
project(${ProjectID} C)

set(CMAKE_C_STANDARD 11)

include_directories("include")

file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.c")
foreach(file ${files})
    #add_executable(TestProject main.c)
    get_filename_component(name ${file} NAME)
    add_executable(${name} ${file} src/snake.c src/tinycthread.c)
endforeach()